<script setup>
import { onLaunch, onShow } from '@dcloudio/uni-app';
import {openDb, executeSql} from '@/sqlite/sqlite.js';
import createTable from '@/sqlite/createTable.js';
var appSocketTimer = null;
onLaunch(async() => { 
	
	//安卓环境才运行
	if(uni.$appConfig.IS_ANDROID){
		// 用户拒绝权限进入基础服务
		const isAgreePrivacy = plus.runtime.isAgreePrivacy(); 
		if (!isAgreePrivacy) {
			console.log('isAgreePrivacy',false);
			if(!uni.getStorageSync(uni.$cacheConfig.TOKENNAME)){
				uni.reLaunch({
				   url: '/pages/login-app/login-app'
				});
				return; 
			}
			 uni.reLaunch({
			    url: '/pages/base-service/base-service' // 你创建的游客模式首页路径
			 });
			return;
		}
	}
	
	let ret =await uni.$get('appapi-config-hidemenu');
	if(ret.data.length > 0){
		let tempList=[];
		let j=0;
		for(let i in uni.$vuex.state.globalData.tabBar.list){
			let isDel=false;
			for(let k=0;k<ret.data.length;k++){
				if(ret.data[k] == uni.$vuex.state.globalData.tabBar.list[i].pagePath){
					isDel=true;
					break;
				}
			}
			if(!isDel) tempList[j++]=uni.$vuex.state.globalData.tabBar.list[i];
		}
		uni.$vuex.state.globalData.tabBar.list=tempList;
		//console.log('appapi-config-hidemenu',uni.$vuex.state.globalData.tabBar.list);
	}
	uni.TIM.listen();
    uni.TIM.login();
	//console.log('App onLaunch');
})
 
onShow(() => {
   //console.log('App Show');
})

</script>
<style lang="scss">
	/*每个页面公共css */
	@import "./static/font_4932459/iconfont.css";
	@import "./uni_modules/vk-uview-ui/index.scss";
	@import '@/static/css/common.css';
	
</style>
